package pw.hais.braintwists.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import pw.hais.braintwists.R;
import pw.hais.braintwists.app.BaseActivity;
import pw.hais.utils.SPUtils;

/**
 * Created by Hais1992 on 2015/12/11.
 */
public class UserActivity extends BaseActivity implements View.OnClickListener {
    private TextView text_createdAt;
    private Button btn_out;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);

        text_createdAt = (TextView) findViewById(R.id.text_createdAt);
        btn_out = (Button) findViewById(R.id.btn_out);
        btn_out.setOnClickListener(this);

        text_createdAt.setText("" + app.user.createdAt);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_out:
                SPUtils.delObject("User");
                app.user = null;
                finish();
                break;
        }
    }
}
